//
//  LKOrderCheckedRecordCell.m
//  YLHelper
//
//  Created by she1323 on 2018/7/6.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKOrderCheckedRecordCell.h"

@interface LKOrderCheckedRecordCell()

@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *applyNameLabel;

@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *chekedLabel;

@end


@implementation LKOrderCheckedRecordCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setModel:(LKApprovaModel *)model{
    _model = model;
    NSString *dateStr = [[_model.approvalTime componentsSeparatedByString:@"T"] firstObject];
        NSString *dateStr1 = [[_model.approvalTime componentsSeparatedByString:@"T"] lastObject];
    NSArray *arra = [dateStr1 componentsSeparatedByString:@":"];
    NSString *dateStr3 = [NSString stringWithFormat:@"%@:%@",arra[0],arra[1]];
    NSString *dateStr4 = [NSString stringWithFormat:@"%@ %@",dateStr,dateStr3];
    self.timeLabel.text = dateStr4;
    self.applyNameLabel.text = _model.applyUserName;
    self.statusLabel.text = [self backApprovType:[_model.approvalStatus integerValue]];
    self.contentLabel.text = _model.approvalContent;
    self.chekedLabel.text = _model.approvalUserName;
}

/**
 审批状态

 */
-(NSString *)backApprovType:(NSInteger)type{
    if (type == 0) {
        return @"待审批";
    }else if (type == 1){
        return @"审批通过";
    }else{
        return @"审批未通过";
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
